package rs.frenjoynet.music.ui;

import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.In;
import org.jboss.seam.ScopeType;
import rs.frenjoynet.music.ui.session.MusicSessionBean;
import rs.frenjoynet.music.ui.session.AlbumSessionBean;
import rs.frenjoynet.music.core.MusicFacade;
import rs.frenjoynet.music.core.entity.Album;

/**
 * Created by IntelliJ IDEA.
 * User: ppopovic
 * Date: Mar 4, 2010
 * Time: 12:38:01 PM
 * To change this template use File | Settings | File Templates.
 */
@AutoCreate
@Name ("musicResponseBean")
@Scope (ScopeType.EVENT)
public class MusicResponseBean
{
	@In ("sessionBean")
	private MusicSessionBean musicSessionBean;
	@In ("albumSessionBean")
	private AlbumSessionBean albumSessionBean;

	public void doSomething()
	{
		getMusicFacade().create((Album)albumSessionBean.getCurrentObject());
	}

	private MusicFacade getMusicFacade()
	{
		return musicSessionBean.getMusicFacadeBean();
	}

	public String getResponse()
	{
		return getMusicFacade().getResponse();
	}
}
